#ifndef _SLEIPNER_CONFIG_H_
#define	_SLEIPNER_CONFIG_H_

//////////////////////////////////////
//
// Use this file to setup configuration options for Sleipner
// This is part of the process to get cross-platform compatibility up and running

//////////////////////////////////////////
/// Enable/Disable specific subsystems
// enable this one to compile in the WiiMote code
//#define _ENABLE_WIIMOTE			// noone is using this anyways
// enable this if you want to use Paul Nettle's Memory Manager
//#define _ENABLE_PN_MMGR
// enable this if you need the output logger to be threadsafe
//#define _LOGGER_MT_
//////////////////////////////////////////////////////
// LuaPlus setup
//#define LUA_OPNAMES
//#define	LUAPLUS_LIB
//#define LUAPLUS_LIB 

// TODO: Fix this hack to keep the two versions compiling nicely on the different compilers
#ifdef __MWERKS__
// define that this is a little-endian architecture
#define _BIG_ENDIAN_ARCHITECTURE
// enable this if the target is Wii
#define _PLATFORM_WII 1
#endif //__MWERKS__

#ifdef _WIN32
// define that this is a little-endian architecture
#define _LITTLE_ENDIAN_ARCHITECTURE
// enable this if the target is PC/Win32
//#define _PLATFORM_WIN32 1

#define _PLATFORM_WIN32
// enable enable this if you want to compile in LuaBind (a C++ binder for Lua/LuaPlus 5.1)
#define _ENABLE_LUABIND
#endif //_WIN32

//#define _PLATFORM_SDL

// TODO: Code for byte-mangling
// Win32 and some other platforms are

#ifdef _LITTLE_ENDIAN_ARCHITECTURE
#define cpu_to_le16(x) (x)
#define cpu_to_le32(x) (x)
#endif //_LITTLE_ENDIAN_ARCHITECTURE

#ifdef _BIG_ENDIAN_ARCHITECTURE
extern inline unsigned short cpu_to_le16(unsigned short x) { return (x<<8) | (x>>8);}
extern inline unsigned long cpu_to_le32(unsigned long x) { return((x>>24) |((x>>8)&0xff00) | ((x<<8)&0xff0000) | (x<<24));}

#endif //_BIG_ENDIAN_ARCHITECTURE


// enable this if the target is Mac
//#define _PLATFORM_MAC

// enable this one to compile the graphics against opengl instead
//#define _ENABLE_OPENGL_
// enable this one to compile against DX8
#define _ENABLE_DX8




/////////////////////////////////////////////////
// compiler configuration
#ifdef _WIN32
#pragma warning(disable: 4996)	// disable stupid MS error message for non-iso std:: containers
#endif	


#ifdef __MWERKS__
#pragma warning off (10216)      // illegal empty declaration used ( ; ; )
#pragma warning off (10317)		 // implicit casting between signed and unsigned; CW can be a bit rigid about this
#pragma warning off (10182)		 // don't care about incoming variables not being used.
#pragma warning off (10207)		 // there's nothing wrong in assignemnt inside if statement
#pragma warning off (10342)		 // there's nothing wrong in assignemnt inside if statement
#endif


/////////////////////////////////////////////
// Codewarrior requires a bunch of standard includes that are part of windows.h
// easier to put them all here
#ifdef _PLATFORM_WII
#ifndef _ENABLE_WIIMOTE // always compile in the Wiimote for Wii.. 
	#define _ENABLE_WIIMOTE
#define _LOAD_PRECOMPILED_LUA		// enable transparent loading of precompiled lua files. The wii's sensitive to this
#endif // _ENABLE_WIIMOTE

#include <revolution.h>
#include <revolution/gx.h>
#ifdef __cplusplus
	#include <stddef.h>
	#include <ctype.h>
	#include <wctype.h>
	#include <extras_wchar.h>
	#include <stdio.h>
	//#include <memory>
	#include <string.h>
	#include <math.h>
#endif // __cplusplus
#endif //_PLATFORM_WII

#ifdef _PLATFORM_WIN32
// provide at least WinXP level support
	#ifdef __cplusplus
	#include <windows.h>
	#endif // __cplusplus
#endif//_PLATFORM_WIN32

#ifdef __APPLE_
#define strcmpi strcasecmp
#define stricmp strcasecmp
#endif __APPLE_

// define standard types (us32, s32, etc) here?
#ifndef WIN32
#ifndef __stdcall
# ifdef __i386__
#  ifdef __GNUC__
#   ifdef __APPLE__ /* Mac OS X uses a 16-byte aligned stack and not a 4-byte one */
#    define __stdcall __attribute__((__stdcall__)) __attribute__((__force_align_arg_pointer__))
#   else
#    define __stdcall __attribute__((__stdcall__))
#   endif
#  elif defined(_MSC_VER)
/* Nothing needs to be done. __stdcall already exists */
#  else
#   error You need to define __stdcall for your compiler
#  endif
# else  /* __i386__ */
#  define __stdcall
# endif  /* __i386__ */
#endif /* __stdcall */

#endif //_SLEIPNER_CONFIG_H_

// custom
#define _NOLOCALIZATION_

#endif




